const MOCK_SERVER_CONFIG = {
  heartbeatInterval: 5,
  baseDir: '.',
  transactionExpireTime: 5,
  crypto: {
    hashKey: '69fa4195670576c0160d660c3be36556ff8d504725be8a59b5a96509e0c994bc',
  },
  p2p: {
    ipServer: 'api.ipify.org/?format=json',
    timeServers: ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'],
    existingArchivers: [
      {
        ip: '127.0.0.1',
        port: 4000,
        publicKey: '758b1c119412298802cd28dbfa394cdfeecc4074492d60844cc192d632d84de3',
      },
      {
        ip: '127.0.0.1',
        port: 4001,
        publicKey: 'e4b5e3d51e727f897786a1bb176a028ecfe1941bfa5beefd3c6209c3dbc07cf7',
      },
    ],
    syncLimit: 180,
    cycleDuration: 30,
    maxRejoinTime: 20,
    difficulty: 2,
    queryDelay: 1,
    gossipRecipients: 8,
    gossipFactor: 4,
    gossipStartSeed: 15,
    gossipSeedFallof: 15,
    gossipTimeout: 180,
    maxSeedNodes: 10,
    minNodesToAllowTxs: 1,
    baselineNodes: 15,
    minNodes: 15,
    maxNodes: 30,
    seedNodeOffset: 4,
    nodeExpiryAge: 30,
    maxJoinedPerCycle: 1,
    maxSyncingPerCycle: 5,
    syncBoostEnabled: true,
    maxSyncTimeFloor: 1200,
    maxNodeForSyncTime: 9,
    maxRotatedPerCycle: 1,
    firstCycleJoin: 10,
    maxPercentOfDelta: 40,
    minScaleReqsNeeded: 5,
    maxScaleReqs: 200,
    scaleConsensusRequired: 0.25,
    amountToGrow: 1,
    amountToShrink: 1,
    maxDesiredMultiplier: 1.2,
    startInWitnessMode: false,
    experimentalSnapshot: true,
    detectLostSyncing: true,
    scaleGroupLimit: 25,
    useSignaturesForAuth: false,
    forcedMode: '',
  },
  ip: {
    externalIp: '0.0.0.0',
    externalPort: 9001,
    internalIp: '0.0.0.0',
    internalPort: 10001,
  },
  network: { timeout: 5 },
  reporting: {
    report: true,
    recipient: 'http://127.0.0.1:3000/api',
    interval: 2,
    console: false,
  },
  debug: {
    ignoreScaleGossipSelfCheck: false,
    loseReceiptChance: 0,
    loseTxChance: 0,
    canDataRepair: false,
    startInFatalsLogMode: false,
    startInErrorLogMode: true,
    verboseNestedCounters: false,
    fakeNetworkDelay: 0,
    disableSnapshots: true,
    disableTxCoverageReport: true,
    haltOnDataOOS: false,
    countEndpointStart: -1,
    countEndpointStop: -1,
    hashedDevAuth: '',
    devPublicKey: '',
    newCacheFlow: true,
    debugNoTxVoting: false,
    ignoreRecieptChance: 0,
    ignoreVoteChance: 0,
    failReceiptChance: 0,
    voteFlipChance: 0,
    skipPatcherRepair: false,
    failNoRepairTxChance: 0,
    useNewParitionReport: false,
    oldPartitionSystem: false,
    dumpAccountReportFromSQL: false,
    profiler: false,
    robustQueryDebug: false,
    forwardTXToSyncingNeighbors: false,
    recordAcceptedTx: false,
    recordAccountStates: false,
  },
  statistics: { save: true, interval: 1 },
  loadDetection: {
    queueLimit: 1000,
    executeQueueLimit: 1000.0,
    desiredTxTime: 15,
    highThreshold: 0.5,
    lowThreshold: 0.2,
  },
  rateLimiting: {
    limitRate: true,
    loadLimit: {
      internal: 0.5,
      external: 0.4,
      txTimeInQueue: 0.2,
      queueLength: 0.2,
      executeQueueLength: 0.2,
    },
  },
  stateManager: {
    stateTableBucketSize: 500,
    accountBucketSize: 200,
    patcherAccountsPerRequest: 250,
    patcherAccountsPerUpdate: 2500,
    patcherMaxHashesPerRequest: 300,
    patcherMaxLeafHashesPerRequest: 300,
    patcherMaxChildHashResponses: 2000,
    maxDataSyncRestarts: 5,
    maxTrackerRestarts: 5,
    syncWithAccountOffset: true,
    useAccountCopiesTable: false,
  },
  sharding: { nodesPerConsensusGroup: 5, nodesPerEdge: 2, executeInOneShard: false },
  mode: 'Debug',
}

const MOCK_LOGS_CONFIG = {
  saveConsoleOutput: true,
  dir: 'logs',
  files: { main: '', fatal: '', net: '', app: '' },
  options: {
    appenders: {
      out: { type: 'console', maxLogSize: 10000000, backups: 10 },
      main: { type: 'file', maxLogSize: 10000000, backups: 10 },
      app: { type: 'file', maxLogSize: 10000000, backups: 10 },
      p2p: { type: 'file', maxLogSize: 10000000, backups: 10 },
      snapshot: { type: 'file', maxLogSize: 10000000, backups: 10 },
      cycle: { type: 'file', maxLogSize: 10000000, backups: 10 },
      fatal: { type: 'file', maxLogSize: 10000000, backups: 10 },
      exit: { type: 'file', maxLogSize: 10000000, backups: 10 },
      errorFile: { type: 'file', maxLogSize: 10000000, backups: 10 },
      errors: { type: 'logLevelFilter', level: 'ERROR', appender: 'errorFile' },
      net: { type: 'file', maxLogSize: 10000000, backups: 10 },
      playback: { type: 'file', maxLogSize: 10000000, backups: 10 },
      shardDump: { type: 'file', maxLogSize: 10000000, backups: 10 },
      statsDump: { type: 'file', maxLogSize: 10000000, backups: 10 },
    },
    categories: {
      default: { appenders: ['out'], level: 'trace' },
      app: { appenders: ['app', 'errors'], level: 'trace' },
      main: { appenders: ['main', 'errors'], level: 'trace' },
      p2p: { appenders: ['p2p'], level: 'trace' },
      snapshot: { appenders: ['snapshot'], level: 'trace' },
      cycle: { appenders: ['cycle'], level: 'trace' },
      fatal: { appenders: ['fatal'], level: 'fatal' },
      exit: { appenders: ['exit'], level: 'fatal' },
      net: { appenders: ['net'], level: 'trace' },
      playback: { appenders: ['playback'], level: 'trace' },
      shardDump: { appenders: ['shardDump'], level: 'trace' },
      statsDump: { appenders: ['statsDump'], level: 'trace' },
    },
  },
}

const MOCK_STORAGE_CONFIG = {
  database: 'database',
  username: 'username',
  password: 'password',
  options: {
    logging: false,
    host: 'localhost',
    dialect: 'sqlite',
    operatorsAliases: false,
    pool: { max: 5, min: 0, acquire: 30000, idle: 10000 },
    storage: 'db/db.sqlite',
    sync: { force: false },
    memoryFile: false,
    saveOldDBFiles: false,
    walMode: true,
    exclusiveLockMode: true,
  },
}

export const MOCK_SHARDUS_CONFIG = {
  server: MOCK_SERVER_CONFIG,
  logs: MOCK_LOGS_CONFIG,
  storage: MOCK_STORAGE_CONFIG,
}
